package com.sa.ibiz.demo.demo.domain;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty.Access;
import lombok.Data;
import org.springframework.beans.BeanUtils;
import org.springframework.cglib.beans.BeanMap;
import org.springframework.cglib.beans.BeanGenerator;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.FieldFill;
import java.util.Map;
import java.util.HashMap;
import org.springframework.util.StringUtils;
import com.sa.ibiz.demo.ibizutil.security.AuthenticationUser;
import java.util.Date;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import org.springframework.util.DigestUtils;
import org.springframework.util.StringUtils;
import java.util.UUID;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import org.springframework.cglib.beans.BeanCopier;
import com.sa.ibiz.demo.ibizutil.annotation.Dict;
import com.sa.ibiz.demo.ibizutil.domain.EntityBase;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import java.math.BigInteger;
import com.sa.ibiz.demo.ibizutil.enums.FillMode;
import com.sa.ibiz.demo.ibizutil.enums.PredefinedType;
import com.sa.ibiz.demo.ibizutil.annotation.PreField;
import com.alibaba.fastjson.annotation.JSONField;

import com.sa.ibiz.demo.demo.domain.CodeItem;
import com.sa.ibiz.demo.demo.domain.CodeList;

/**
 * 实体[CodeItem] 数据对象
 */
@TableName(value = "T_SRFCODEITEM",resultMap = "CodeItemResultMap")
@JsonIgnoreProperties(ignoreUnknown = true)
@Data
public class CodeItem extends EntityBase implements Serializable{

    @JSONField(serialize = false)
    @JsonIgnore
    @TableField(exist = false)//关系主表数据
    private CodeItem pcodeitem;
    @JSONField(serialize = false)
    @JsonIgnore
    @TableField(exist = false)//关系主表数据
    private CodeList codelist;
    @TableId(value= "codeitemid",type=IdType.UUID)//指定主键生成策略
    private String codeitemid;
    private String codeitemname;
    private String codeitemvalue;
    private String codelistid;
    @TableField(exist = false)//逻辑属性
    private String codelistname;
    @PreField(fill= FillMode.INSERT,preType = PredefinedType.CREATEDATE)
    private Timestamp createdate;
    @PreField(fill= FillMode.INSERT,preType = PredefinedType.CREATEMAN)
    @Dict(dictName = "WorkflowMob_SysOperatorCodeList")
    private String createman;
    private String memo;
    private Integer ordervalue;
    private String pcodeitemid;
    @TableField(exist = false)//逻辑属性
    private String pcodeitemname;
    private String shortkey;
    @PreField(fill= FillMode.INSERT_UPDATE,preType = PredefinedType.UPDATEDATE)
    private Timestamp updatedate;
    @PreField(fill= FillMode.INSERT_UPDATE,preType = PredefinedType.UPDATEMAN)
    @Dict(dictName = "WorkflowMob_SysOperatorCodeList")
    private String updateman;
    /**
     *  设置属性值[代码项标识]
     *  @param codeitemid
     */
    public void setCodeitemid(String codeitemid){
        if(StringUtils.isEmpty(codeitemid))
            codeitemid=null;
        this.codeitemid = codeitemid;
        this.set("codeitemiddirtyflag",true);
    }
    /**
     *  获取属性值[代码项标识]
     */
    public String getCodeitemid(){
        return this.codeitemid;
    }
    /**
     *  重置属性值[代码项标识]
     */
    public void resetCodeitemid(){
        this.set("codeitemiddirtyflag",false);
        this.codeitemid = null;
    }
    /**
     *  设置属性值[代码项名称]
     *  @param codeitemname
     */
    public void setCodeitemname(String codeitemname){
        if(StringUtils.isEmpty(codeitemname))
            codeitemname=null;
        this.codeitemname = codeitemname;
        this.set("codeitemnamedirtyflag",true);
    }
    /**
     *  获取属性值[代码项名称]
     */
    public String getCodeitemname(){
        return this.codeitemname;
    }
    /**
     *  重置属性值[代码项名称]
     */
    public void resetCodeitemname(){
        this.set("codeitemnamedirtyflag",false);
        this.codeitemname = null;
    }
    /**
     *  设置属性值[代码项值]
     *  @param codeitemvalue
     */
    public void setCodeitemvalue(String codeitemvalue){
        if(StringUtils.isEmpty(codeitemvalue))
            codeitemvalue=null;
        this.codeitemvalue = codeitemvalue;
        this.set("codeitemvaluedirtyflag",true);
    }
    /**
     *  获取属性值[代码项值]
     */
    public String getCodeitemvalue(){
        return this.codeitemvalue;
    }
    /**
     *  重置属性值[代码项值]
     */
    public void resetCodeitemvalue(){
        this.set("codeitemvaluedirtyflag",false);
        this.codeitemvalue = null;
    }
    /**
     *  设置属性值[代码表]
     *  @param codelistid
     */
    public void setCodelistid(String codelistid){
        if(StringUtils.isEmpty(codelistid))
            codelistid=null;
        this.codelistid = codelistid;
        this.set("codelistiddirtyflag",true);
    }
    /**
     *  获取属性值[代码表]
     */
    public String getCodelistid(){
        return this.codelistid;
    }
    /**
     *  重置属性值[代码表]
     */
    public void resetCodelistid(){
        this.set("codelistiddirtyflag",false);
        this.codelistid = null;
    }
    /**
     *  设置属性值[代码表]
     *  @param codelistname
     */
    public void setCodelistname(String codelistname){
        if(StringUtils.isEmpty(codelistname))
            codelistname=null;
        this.codelistname = codelistname;
        this.set("codelistnamedirtyflag",true);
    }
    /**
     *  获取属性值[代码表]
     */
    public String getCodelistname(){
        return this.codelistname;
    }
    /**
     *  重置属性值[代码表]
     */
    public void resetCodelistname(){
        this.set("codelistnamedirtyflag",false);
        this.codelistname = null;
    }
    /**
     *  设置属性值[建立时间]
     *  @param createdate
     */
    public void setCreatedate(Timestamp createdate){
        this.createdate = createdate;
        this.set("createdatedirtyflag",true);
    }
    /**
     *  获取属性值[建立时间]
     */
    public Timestamp getCreatedate(){
        return this.createdate;
    }
    /**
     *  重置属性值[建立时间]
     */
    public void resetCreatedate(){
        this.set("createdatedirtyflag",false);
        this.createdate = null;
    }
    /**
     *  设置属性值[建立人]
     *  @param createman
     */
    public void setCreateman(String createman){
        if(StringUtils.isEmpty(createman))
            createman=null;
        this.createman = createman;
        this.set("createmandirtyflag",true);
    }
    /**
     *  获取属性值[建立人]
     */
    public String getCreateman(){
        return this.createman;
    }
    /**
     *  重置属性值[建立人]
     */
    public void resetCreateman(){
        this.set("createmandirtyflag",false);
        this.createman = null;
    }
    /**
     *  设置属性值[备注]
     *  @param memo
     */
    public void setMemo(String memo){
        if(StringUtils.isEmpty(memo))
            memo=null;
        this.memo = memo;
        this.set("memodirtyflag",true);
    }
    /**
     *  获取属性值[备注]
     */
    public String getMemo(){
        return this.memo;
    }
    /**
     *  重置属性值[备注]
     */
    public void resetMemo(){
        this.set("memodirtyflag",false);
        this.memo = null;
    }
    /**
     *  设置属性值[排序值]
     *  @param ordervalue
     */
    public void setOrdervalue(Integer ordervalue){
        this.ordervalue = ordervalue;
        this.set("ordervaluedirtyflag",true);
    }
    /**
     *  获取属性值[排序值]
     */
    public Integer getOrdervalue(){
        return this.ordervalue;
    }
    /**
     *  重置属性值[排序值]
     */
    public void resetOrdervalue(){
        this.set("ordervaluedirtyflag",false);
        this.ordervalue = null;
    }
    /**
     *  设置属性值[上级代码项]
     *  @param pcodeitemid
     */
    public void setPcodeitemid(String pcodeitemid){
        if(StringUtils.isEmpty(pcodeitemid))
            pcodeitemid=null;
        this.pcodeitemid = pcodeitemid;
        this.set("pcodeitemiddirtyflag",true);
    }
    /**
     *  获取属性值[上级代码项]
     */
    public String getPcodeitemid(){
        return this.pcodeitemid;
    }
    /**
     *  重置属性值[上级代码项]
     */
    public void resetPcodeitemid(){
        this.set("pcodeitemiddirtyflag",false);
        this.pcodeitemid = null;
    }
    /**
     *  设置属性值[上级代码项]
     *  @param pcodeitemname
     */
    public void setPcodeitemname(String pcodeitemname){
        if(StringUtils.isEmpty(pcodeitemname))
            pcodeitemname=null;
        this.pcodeitemname = pcodeitemname;
        this.set("pcodeitemnamedirtyflag",true);
    }
    /**
     *  获取属性值[上级代码项]
     */
    public String getPcodeitemname(){
        return this.pcodeitemname;
    }
    /**
     *  重置属性值[上级代码项]
     */
    public void resetPcodeitemname(){
        this.set("pcodeitemnamedirtyflag",false);
        this.pcodeitemname = null;
    }
    /**
     *  设置属性值[快捷输入]
     *  @param shortkey
     */
    public void setShortkey(String shortkey){
        if(StringUtils.isEmpty(shortkey))
            shortkey=null;
        this.shortkey = shortkey;
        this.set("shortkeydirtyflag",true);
    }
    /**
     *  获取属性值[快捷输入]
     */
    public String getShortkey(){
        return this.shortkey;
    }
    /**
     *  重置属性值[快捷输入]
     */
    public void resetShortkey(){
        this.set("shortkeydirtyflag",false);
        this.shortkey = null;
    }
    /**
     *  设置属性值[更新时间]
     *  @param updatedate
     */
    public void setUpdatedate(Timestamp updatedate){
        this.updatedate = updatedate;
        this.set("updatedatedirtyflag",true);
    }
    /**
     *  获取属性值[更新时间]
     */
    public Timestamp getUpdatedate(){
        return this.updatedate;
    }
    /**
     *  重置属性值[更新时间]
     */
    public void resetUpdatedate(){
        this.set("updatedatedirtyflag",false);
        this.updatedate = null;
    }
    /**
     *  设置属性值[更新人]
     *  @param updateman
     */
    public void setUpdateman(String updateman){
        if(StringUtils.isEmpty(updateman))
            updateman=null;
        this.updateman = updateman;
        this.set("updatemandirtyflag",true);
    }
    /**
     *  获取属性值[更新人]
     */
    public String getUpdateman(){
        return this.updateman;
    }
    /**
     *  重置属性值[更新人]
     */
    public void resetUpdateman(){
        this.set("updatemandirtyflag",false);
        this.updateman = null;
    }
     /**
     *  获取主实体关联数据[CodeItem]
     */
    public CodeItem getPcodeitem() {
        return pcodeitem;
    }
    /**
     *  设置主实体关联数据[CodeItem]
     */
    public void setPcodeitem(CodeItem pcodeitem) {
        this.pcodeitem = pcodeitem;
    }

     /**
     *  获取主实体关联数据[CodeList]
     */
    public CodeList getCodelist() {
        return codelist;
    }
    /**
     *  设置主实体关联数据[CodeList]
     */
    public void setCodelist(CodeList codelist) {
        this.codelist = codelist;
    }

    /**
     * 重置当前数据对象属性值
     */
    public  void reset(){
        resetCodeitemid();
        resetCodeitemname();
        resetCodeitemvalue();
        resetCodelistid();
        resetCodelistname();
        resetCreatedate();
        resetCreateman();
        resetMemo();
        resetOrdervalue();
        resetPcodeitemid();
        resetPcodeitemname();
        resetShortkey();
        resetUpdatedate();
        resetUpdateman();
    }
     /**
     * 获取数据主键（普通主键与联合主键）
     * @return
     */
    @JsonIgnore
    public Serializable getDefaultPrimaryKey()
    {
	    //随机生成主键
         return  IdWorker.get32UUID();

    }
     /**
     * 复制当前对象数据到目标对象(粘贴重置)
     *
     * @throws Exception
     */
    public CodeItem copyTo(CodeItem targetEntity)
	{
		BeanCopier copier=BeanCopier.create(CodeItem.class, CodeItem.class, false);
		copier.copy(this, targetEntity, null);
        targetEntity.resetCodeitemid();
		return targetEntity;
	}
}